﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using BBECServiceBusAdapter_CodeGenLib.EditForms.ProspectTeam;

namespace BBECServiceBusAdapter.Helper_Activities.Inbound
{

    public sealed class PocessProspectTeamEdit : CodeActivity
    {
        // Define an activity input argument of type string
        public InArgument<Guid> ProspectId { get; set; }
        public InArgument<Guid> FundraiserId { get; set; }
        public InArgument<DateTime?> DateFrom { get; set; }
        public InArgument<DateTime?> DateTo { get; set; }

        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void Execute(CodeActivityContext context)
        {
            Guid inProspectGuid = context.GetValue(this.ProspectId);
            Guid inFundraiserGuid = context.GetValue(this.FundraiserId);
            DateTime inDateFrom = (DateTime)context.GetValue(this.DateFrom);
            DateTime inDateTo = (DateTime)context.GetValue(this.DateTo);

            ProspectTeamEditDataFormData frmData = new ProspectTeamEditDataFormData();

            frmData.RecordID = inProspectGuid.ToString();
            frmData.FundraiserId = inFundraiserGuid;
            frmData.DateFrom = inDateFrom;
            frmData.DateFrom = inDateTo;

            frmData.Save(new Blackbaud.AppFx.WebAPI.AppFxWebServiceProvider(Blackbaud.AppFx.Workflow.CatalogActivities.WebApiUtility.GetAppFxWebApiProvider(context).ConnectionString));


        }
    }
}
